cmake_minimum_required(VERSION 3.12)	#声明cmake需要的最低版本
project(week04)	#声明cmake项目的名称

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

find_package(OpenCV REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS})	#添加OpenCV头文件
add_executable(${PROJECT_NAME} src/main.cpp src/)	#生成可执行文件，这里我把可执行文件名称定义成项目名称
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})	#链接OpenCV库文件到cmake项目上

